﻿using System;
using System.Collections.Generic;

namespace Hongsh.Pay.Client.Proxy.Http {
    // Token: 0x02000026 RID: 38
    public class HttpHeader : Dictionary<string, string> {
        // Token: 0x17000070 RID: 112
        // (get) Token: 0x06000117 RID: 279 RVA: 0x00002BEA File Offset: 0x00000DEA
        // (set) Token: 0x06000118 RID: 280 RVA: 0x00002BF2 File Offset: 0x00000DF2
        public string Version { get; set; }

        // Token: 0x17000071 RID: 113
        // (get) Token: 0x06000119 RID: 281 RVA: 0x0000B57C File Offset: 0x0000977C
        // (set) Token: 0x0600011A RID: 282 RVA: 0x00002BFB File Offset: 0x00000DFB
        public int ContentLength {
            get {
                string s;
                return TryGetValue("Content-Length", out s) ? int.Parse(s) : 0;
            }
            set => base["Content-Length"] = value.ToString();
        }

        // Token: 0x17000072 RID: 114
        // (get) Token: 0x0600011B RID: 283 RVA: 0x0000B5A4 File Offset: 0x000097A4
        // (set) Token: 0x0600011C RID: 284 RVA: 0x00002C0F File Offset: 0x00000E0F
        public string ContentType {
            get {
                string text;
                return TryGetValue("Content-Type", out text) ? text : null;
            }
            set => base["Content-Type"] = value;
        }

        // Token: 0x17000073 RID: 115
        // (get) Token: 0x0600011D RID: 285 RVA: 0x0000B5C4 File Offset: 0x000097C4
        // (set) Token: 0x0600011E RID: 286 RVA: 0x00002C1D File Offset: 0x00000E1D
        public bool KeepAlive {
            get {
                string text;
                return !TryGetValue("Connection", out text) || !text.Equals("Close", StringComparison.OrdinalIgnoreCase);
            }
            set => base["Connection"] = value ? "Keep-Alive" : "Close";
        }

        // Token: 0x0600011F RID: 287 RVA: 0x00002C39 File Offset: 0x00000E39
        public HttpHeader() : base() {
            //Class15.cwcZ3SWztHroi();
            Version = "HTTP/1.1";
            //base..ctor();
            ContentLength = 0;
        }
    }
}
